package com.ticket.sass.common.entity.tenant;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author ywb
 * @since 2022-01-07
 */
@Data
@EqualsAndHashCode
@TableName("role_resource_maps")
public class RoleResourceMapEntity implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private Long roleId;

    private Long resourceId;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @TableLogic(value = "null", delval = "now()")
    @TableField(select = false)
    private LocalDateTime deletedAt;

    /**
     * 补充字段
     */

    @TableField(value = "resource_type", exist = false )
    private Long resourceType;

    @TableField(value = "resource_name", exist = false )
    private String resourceName;

    @TableField(value = "role_name", exist = false )
    private String roleName;

    @TableField(value = "resources_data", exist = false )
    private String resourcesData;

    @TableField(value = "resources_parent_id", exist = false )
    private Long resourcesParentId;
    

    public RoleResourceMapEntity() {
    }

    public RoleResourceMapEntity(Long roleId, Long resourceId) {
        this.roleId = roleId;
        this.resourceId = resourceId;
    }
}
